﻿<div ng-controller="base1Controller">
    <form name="myForm" class="form-horizontal" ng-submit="save()" ng-show="formVisibility" novalidate>

        <div class="form-group">
            <label class="control-label col-xs-1">Periodo:</label>
            <div class="col-xs-3">
                <select ng-model="base1.EncabezadoId" class="form-control"
                        ng-options="value.Id as value.Periodo for value in encabezadoList  " required>
                    <option>--</option>
                </select>
                <p> Select: {{base1.EncabezadoId}} </p>
            </div>
            <label class="control-label col-sm-2">Fecha Emision:</label>
            <div class="col-xs-2">
                <input type="date" class="form-control" ng-model="base1.FechaEmision" required>
            </div>
            <label class="control-label col-sm-2">Fecha Vencimiento:</label>
            <div class="col-xs-2">
                <input type="date" class="form-control" ng-model="base1.FechaVencimiento">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-sm-1">Tabla 10:</label>
            <div class="col-xs-8 ">
                <select ng-model="base1.Tabla10Id  " class="form-control" style=" width:800px;"
                        ng-options="value.Id as value.Descripcion for value in tabla10List  ">
                    <option>--</option>
                </select>
                <p>Select: {{base1.Tabla10Id}}</p>
            </div>
            <div class="col-xs-3">
                <input type="text" class="form-control" placeholder="Serie" ng-model="base1.Serie" required>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-2">Año de la Emision Dua:</label>
            <div class="col-xs-2">
                <input type="text" class="form-control" placeholder="Año" ng-model="base1.AnoEmisionDua">
            </div>
            <label class="control-label col-xs-2">N Comprobante:</label>
            <div class="col-xs-2">
                <input type="number" class="form-control" ng-model="base1.N_Comprobante " required>
            </div>
            <label class="control-label col-xs-1">Proveedor:</label>
            <div class="col-xs-3 ">
                <select ng-model="base1.ProveedorId" class="form-control" style=" width:260px;"
                        ng-options="value.Id as value.Numero for value in proveedorList  ">
                    <option>--</option>
                </select>
                <p>Select: {{base1.ProveedorId}}</p>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-2">Base Imponible:</label>
            <div class="col-xs-2 ">
                <select ng-model="base1.BaseImponibleId" class="form-control" style=" width:200px;"
                        ng-options="value.Id as value.Nombre for value in baseImponibleList  ">
                    <option>--</option>
                </select>
                <p>Select: {{base1.BaseImponibleId}}</p>
            </div>
            <label class="control-label col-xs-2">Descripcion:</label>
            <div class="col-xs-6">
                <textarea rows="1" class="form-control" placeholder="Descripcion de la Opercion" ng-model="base1.DescripcionM"></textarea>
            </div>
        </div>
        <div class="form-group">
            <div class="col-xs-12">
                <ui-select ng-model='base1.selected' reset-search-input="false" style=" width:1140px;">
                    <ui-select-match placeholder=" Busque Aqui....">
                        {{$select.selected.Id}}. {{$select.selected.Descripcion}}
                    </ui-select-match>
                    <ui-select-choices repeat="e in elementoList | filter: $select.search">
                        {{e.Id}}. {{ e.Descripcion}}
                    </ui-select-choices>

                </ui-select>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-4">Opreracion:</label>
            <div class="col-xs-2">
                <input type="text" class="form-control" placeholder="Numero" ng-model="base1.Operacion1">
            </div>
            <div class="col-xs-2">
                <input type="number" class="form-control" placeholder="Codigo" ng-model="base1.Codigo1 ">
            </div>
            <div class="col-xs-2">
                <input type="number" class="form-control" placeholder="Debe" ng-model="base1.Debe1">
            </div>
            <div class="col-lg-2">
                <input type="number" class="form-control" placeholder="Haber" ng-model="base1.Haber1 ">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-6"></label>
            <div class="col-xs-2">
                <input type="number" class="form-control" placeholder="Codigo" ng-model="base1.Codigo2 ">
            </div>
            <div class="col-xs-2">
                <input type="number" class="form-control" placeholder="Debe" ng-model="base1.Debe2 ">
            </div>
            <div class="col-lg-2">
                <input type="number" class="form-control" placeholder="Haber" ng-model="base1.Haber2 ">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-6"></label>
            <div class="col-xs-2">
                <input type="number" class="form-control" placeholder="Codigo" ng-model="base1.Codigo3 ">
            </div>
            <div class="col-xs-2">
                <input type="number" class="form-control" placeholder="Debe" ng-model="base1.Debe3 ">
            </div>
            <div class="col-lg-2">
                <input type="number" class="form-control" placeholder="Haber" ng-model="base1.Haber3 ">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-4">Opreracion:</label>
            <div class="col-xs-2">
                <input type="text" class="form-control" placeholder="Numero" ng-model="base1.Operacion2">
            </div>
            <div class="col-xs-2">
                <input type="number" class="form-control" placeholder="Codigo" ng-model="base1.Codigo4 ">
            </div>
            <div class="col-xs-2">
                <input type="number" class="form-control" placeholder="Debe" ng-model="base1.Debe4 ">
            </div>
            <div class="col-lg-2">
                <input type="number" class="form-control" placeholder="Haber" ng-model="base1.Haber4 ">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-6"></label>
            <div class="col-xs-2">
                <input type="number" class="form-control" placeholder="Codigo" ng-model="base1.Codigo5 ">
            </div>
            <div class="col-xs-2">
                <input type="number" class="form-control" placeholder="Debe" ng-model="base1.Debe5 ">
            </div>
            <div class="col-lg-2">
                <input type="number" class="form-control" placeholder="Haber" ng-model="base1.Haber5 ">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-4">Opreracion:</label>
            <div class="col-xs-2">
                <input type="text" class="form-control" placeholder="Numero" ng-model="base1.Operacion3">
            </div>
            <div class="col-xs-2">
                <input type="number" class="form-control" placeholder="Codigo" ng-model="base1.Codigo6 ">
            </div>
            <div class="col-xs-2">
                <input type="number" class="form-control" placeholder="Debe" ng-model="base1.Debe6 ">
            </div>
            <div class="col-lg-2">
                <input type="number" class="form-control" placeholder="Haber" ng-model="base1.Haber6 ">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-6"></label>
            <div class="col-xs-2">
                <input type="number" class="form-control" placeholder="Codigo" ng-model="base1.Codigo7 ">
            </div>
            <div class="col-xs-2">
                <input type="number" class="form-control" placeholder="Debe" ng-model="base1.Debe7 ">
            </div>
            <div class="col-lg-2">
                <input type="number" class="form-control" placeholder="Haber" ng-model="base1.Haber7 ">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-3">Adquisiciones No Gravadas :</label>
            <div class="col-xs-2">
                <input type="number" class="form-control" ng-model="base1.AdquisicionesNoGravadas  ">
            </div>
            <label class="control-label col-xs-1">ISC :</label>
            <div class="col-xs-2">
                <input type="number" class="form-control" ng-model="base1.ISC  ">
            </div>
            <label class="control-label col-xs-2">Otros Tributos:</label>
            <div class="col-xs-2">
                <input type="number" class="form-control" ng-model="base1.OtrosTributos  ">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-10">Importe Total:</label>
            <div class="col-xs-2">
                <input type="number" class="form-control" placeholder="Total" ng-model="base1.ImporteTotal" required>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-3">Pago No Domiciliado  :</label>
            <div class="col-xs-2">
                <input type="number" class="form-control" ng-model="base1.PagoNoDomiciliado   ">
            </div>
            <label class="control-label col-xs-1">Numero  :</label>
            <div class="col-xs-2">
                <input type="number" class="form-control" placeholder="CDD" ng-model="base1.CDD_Numero   ">
            </div>
            <label class="control-label col-xs-2">Fecha Emision  :</label>
            <div class="col-xs-2">
                <input type="date" class="form-control" placeholder="CDD" ng-model="base1.CDD_FechaEmision   ">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-2">Tipo de Cambio  :</label>
            <div class="col-xs-2">
                <input type="text" class="form-control" ng-model="base1.TipodeCambio   ">
            </div>
        </div>
        <br>
        <div class="form-group">
            <div class="col-xs-offset-9">
                <button type="button" class="btn btn-default" ng-click="cancel()">Cancel </button>
                <button class="btn btn-success" type="submit">Save</button>
                <input type="reset" class="btn btn-default btn-primary" value="Limpiar">
            </div>
        </div>

    </form>
    <div class="col-md-8">
        <h3>REPORTE DE COMPRAS</h3>
        <div class="input-group col-md-6">
            <input type="text" ng-model="busqueda" class="form-control" placeholder="Buscar" />
            <span class="input-group-btn">
                <button class="btn btn-info" type="button">
                    <i class="glyphicon glyphicon-search"></i>
                </button>
            </span>
        </div>
        <div class="container">
            <table class="table table-striped table-bordered table-btabla2ed table-hover table-responsive">
                <thead>
                    <tr>
                        <td>NÚMERO CORRELATIVO</td>
                        <th>Fecha Emision</th>
                        <th>Fecha Vencimiento</th>
                        <th>Tabla 10</th>
                        <th>Serie</th>
                        <th>Año</th>
                        <th>N Comprobante</th>
                        <th>Tabla 2 </th>
                        <th>Numero </th>
                        <th>Razon Social </th>
                        <th>BaseImponible</th>
                        <th>IGV</th>
                        <th>Adquisiciones No Gravadas</th>
                        <th>ISC</th>
                        <th>Otros Tributos</th>
                        <th>Importe Total</th>
                        <th>Pago No Domiciliado</th>
                        <th>CDD Numero</th>
                        <th>Tipo de Cambio</th>
                        <th>Periodo</th>
                        <th>Opciones</th>
                    </tr>
                </thead>
                <tbody>
                    <tr data-ng-repeat="d in list | filter: busqueda">
                        <td>{{d.Id}}</td>
                        <td>{{d.FechaEmision}}</td>
                        <td>{{d.FechaVencimiento}}</td>
                        <td>{{d.Tabla10Id}}</td>
                        <td>{{d.Serie}}</td>
                        <td>{{d.AnoEmisionDua}}</td>
                        <td>{{d.N_Comprobante}}</td>
                        <td>{{d.ProveedorModel.Tabla2Id}}</td>
                        <td>{{d.ProveedorModel.Numero}}</td>
                        <td>{{d.ProveedorModel.RazonSocial}}</td>
                        <td>{{d.BaseImponibleId}}</td>
                        <td>{{d.Debe2}}</td>
                        <td>{{d.AdquisicionesNoGravadas}}</td>
                        <td>{{d.ISC}}</td>
                        <td>{{d.OtrosTributos}}</td>
                        <td>{{d.ImporteTotal}}</td>
                        <td>{{d.PagoNoDomiciliado}}</td>
                        <td>{{d.CDD_Numero}}</td>
                        <td>{{d.TipodeCambio}}</td>
                        <td>{{d.EncabezadoModel.Periodo}}</td>
                        <td>
                            <button ng-click="getById(d)" type="button" class="btn btn-primary"><i class="glyphicon glyphicon-pencil"></i> <span>Editar</span></button>
                            <button ng-click="delete(d)" type="button" class="btn btn-danger"><i class="glyphicon glyphicon-trash"></i> <span>Eliminar</span></button>
                        </td>

                    </tr>
                </tbody>
            </table>
        </div>
        <button ng-click="ShowForm()" ng-hide="formVisibility" type="button" class="btn btn-primary"><i class="glyphicon glyphicon-plus"></i> Agregar...</button>
 </div>
 </div>